home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 1.iso / dist / patchSG0003743.idb / usr / include / cray / fortio.h.z / fortio.h
C/C++ Source or Header  |  2001-04-12  |  4KB  |  147 lines

  1. /* USMID @(#) clibinc/cray/fortio.h    92.0    10/08/98 14:28:05 */
  2. /*
  3.  *    (C) COPYRIGHT CRAY RESEARCH, INC.
  4.  *    UNPUBLISHED PROPRIETARY INFORMATION.
  5.  *    ALL RIGHTS RESERVED.
  6.  */
  7. #ifndef _CRAY_FORTIO_H
  8. #define _CRAY_FORTIO_H
  9.  
  10. /*
  11.  *    fortio.h    - contains global definitions which pertain
  12.  *              to Fortran I/O.  These definitions are used
  13.  *              by libf and by the procstat and procview
  14.  *              commands.
  15.  */
  16.  
  17. /************************************************************************/
  18. /*                                    */
  19. /*  Constants                                */
  20. /*                                    */
  21. /************************************************************************/
  22.  
  23. /*
  24.  * Fortran I/O types.
  25.  *
  26.  * Modification of this list also requires changes to macro FIO_METHOD.
  27.  */
  28.  
  29. #define FIO_SF  1       /* sequential formatted */
  30. #define FIO_SU  2       /* sequential unformatted */
  31. #define FIO_DF  3       /* direct formatted */
  32. #define FIO_DU  4       /* direct unformatted */
  33.  
  34. /*
  35.  *    File structure constant defintions.
  36.  */
  37.  
  38. #define FS_DEFAULT    0    /* file structure not yet determined    */
  39.  
  40. #define STD        1    /* stdio compatible unblocked or text    */
  41. #define FS_PURE        2    /* pure data (CRAY-2 only)        */
  42. #define FS_COS        3    /* COS blocked                */
  43. #define FS_U        4    /* unblocked -s u            */
  44. #define FS_BIN        5    /* unblocked -s bin (YMP only)        */
  45. #define FS_TAPE        6    /* interchange tape            */
  46. #define FS_FDC        7    /* FFIO file                 */
  47. #define FS_TAPE50    8    /* interchange tape (special rls 5.0)    */
  48. #define FS_TEXT        9    /* newline terminated records        */
  49. #define FS_UNBLOCKED    10    /* no record blocking             */
  50. #define FS_AUX        11    /* an auxiliary type of i/o (e.g. aqio)    */
  51. #define FS_F77        12    /* unformatted structure on workstations*/
  52.  
  53. /*
  54.  * Other constants.
  55.  */
  56.  
  57. #define MXUNITSZ  32       /* Max. size of file name: sizeof("fort.nnn") */
  58.  
  59. /************************************************************************/
  60. /*                                    */
  61. /*  Macros                                */
  62. /*                                    */
  63. /************************************************************************/
  64.  
  65. /*
  66.  * FIO_METHOD    - macro which returns a string describing the I/O type
  67.  *          corresponding to an I/O type code, or NULL if it
  68.  *          is an invalid code.
  69.  *
  70.  *          This macro is used by the procstat command and by _fcontext.
  71.  */
  72. #define FIO_METHOD(_C)                 \
  73.     ( ((_C) == FIO_SF)?            \
  74.         "sequential formatted"        \
  75.     :( ((_C) == FIO_SU)?            \
  76.         "sequential unformatted"    \
  77.     :( ((_C) == FIO_DF)?            \
  78.         "direct formatted"        \
  79.     :( ((_C) == FIO_DU)?            \
  80.         "direct unformatted"        \
  81.     :                     \
  82.         NULL                \
  83.     ))))
  84.  
  85. /*
  86.  * FIO_STRUCT    - macro which returns a string describing the Fortran file
  87.  *          file structure corresponding to an integer  structure code.
  88.  *
  89.  *          This macro is used by the procstat command and by _fcontext.
  90.  */
  91.  
  92. #define FIO_STRUCT(_C)                \
  93.     ( ((_C) == FS_TEXT)?            \
  94.         "text"                \
  95.     :( ((_C) == FS_COS)?            \
  96.         "COS blocked"            \
  97.     :( ((_C) == FS_UNBLOCKED)?        \
  98.         "unblocked"            \
  99.     :( ((_C) == FS_PURE)?            \
  100.         "pure data"            \
  101.     :( ((_C) == FS_U)?            \
  102.         "unblocked"            \
  103.     :( ((_C) == FS_BIN)?            \
  104.         "unblocked"            \
  105.     :( ((_C) == FS_TAPE)?            \
  106.         "tape"                \
  107.     :( ((_C) == FS_TAPE50)?            \
  108.         "tape"                \
  109.     :( ((_C) == STD)?            \
  110.         "unblocked or text"        \
  111.     :( ((_C) == FS_F77)?            \
  112.         "UNIX blocked"            \
  113.     :( ((_C) == FS_FDC)?            \
  114.         "FFIO"                \
  115.     :                    \
  116.         NULL                \
  117.     )))))))))))
  118.  
  119. /************************************************************************/
  120. /*                                    */
  121. /*  Typedefs                                */
  122. /*                                    */
  123. /************************************************************************/
  124.  
  125. /*
  126.  *    Define data types to hold unit and record numbers.  These data
  127.  *    types transcend the Fortran run-time library, and so are defined
  128.  *    here.  Note some of the impacts:
  129.  *
  130.  *    1) All the places where a unit/record number is passed into
  131.  *       the run-time library (and there are many), and
  132.  *
  133.  *    2) All the places where a unit/record number is printed out
  134.  *       or formatted for printed (e.g., "%lld").
  135.  *
  136.  */
  137.  
  138. #ifdef    _CRAY        /* KLUDGE for older C/C++ compilers */
  139. typedef long        unum_t;        /* Fortran unit number */
  140. typedef long        recn_t;        /* Fortran record number */
  141. #else
  142. typedef long long    unum_t;        /* Fortran unit number */
  143. typedef long long    recn_t;        /* Fortran record number */
  144. #endif
  145.  
  146. #endif /* !_CRAY_FORTIO_H */
  147.